import { apiUrl } from '~/config';
import Request from '~/core/request';

// export function register (data) {
// 	Request.post(`${apiUrl}/cook/user/register`, data);
// }

export function getCookInfo (Id) {
	return Request.get(`${apiUrl}/cooks/${Id}`);
}

export function getMyWorks (Id) {
	return Request.get(`${apiUrl}/cooks/${Id}/showcases`);
}

export function modifyCooks (data) {
	return Request.put(`${apiUrl}/cooks`, data);
}

export function creatCooks (data) {
	return Request.post(`${apiUrl}/cooks`, data);
}

export function modifyWorks (data) {
	return Request.put(`${apiUrl}/showcases`, data);
}

export function creatWorks (data) {
	return Request.post(`${apiUrl}/showcases`, data);
}

export function deleteWorks (Id) {
	return Request.delete(`${apiUrl}/showcases/${Id}`);
}

export function getMyResume (Id) {
	return Request.get(`${apiUrl}/cooks/${Id}/job-histories`);
}

export function creatResume (data) {
	return Request.post(`${apiUrl}/job-histories`, data);
}

export function modifyResume (data) {
	return Request.put(`${apiUrl}/job-histories`, data);
}

export function deleteResume (Id) {
	return Request.delete(`${apiUrl}/job-histories/${Id}`);
}

export function getWxSignature (url) {
	return Request.get(`${apiUrl}/wechat/getJsapiSignature`, {url});
}

export function getMyinfo () {
	return Request.get(`${apiUrl}/cooks/my`);
}

export function getMyWxinfo () {
	return Request.get(`${apiUrl}/wechat/userinfo`);
}

export function getQrcode (url) {
	return Request.get(`${apiUrl}/qrcode`, {url});
}

